Fixed various server crashes