Fixed minor bugs which crashed server side