Some fixes for integration with syberia

Still needs tests