Some micro optimisations and fixed formdao autowiring bug