ugly fix to minLength not working and some other tune ups