Small fixes to make it work on server.