assembly fixes

fixes open/closed handling, and removes problematic assembly code