Added some fixes for errors