Some dirty hacks to get it work on the actual RESTAS version