Bug fixes to make the thing actually work inside laravel