Bug fixes while testing controller