Updated to version 1.0.1, made validation more robust