Fixed several validation issues (Thanks startexe for the report).