Add HLT command length
Fix wait_semaphore locking
Fix incrementing position in memory