Fix line editing and loadmod error checking