Fixed issue where lock byte wasn't the last byte written to flash.