Fixed bug where the datamodel was instantiated too late, creating nullpointer exceptions when the datamodel field was used.