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