small improvements
improved error