Fixed #374. Added support for newer wtform versions