Fixed the usage of $flags in loadLastEdit()