Fix some bad code placement