Fix bugs with loading user code