Fixed some bugs that led to exceptions
Added stuff. Dunno wtf happened. Confused by Glögg-SM...