Some validation, and stuff (not much)