Fixed some bugs todo with missing validation