Working program loading into memory. Minor fixes to detectCommand.