Added specs and some fixes in the related controllers