Some fixes in controller