Small patch to last commit, fixes an exception being thrown