Ran on empire. Cleaned up some error handling.