Fixed various issues based on Jamesons comments