Bug: crud generator makes wrong form

Added tests