Updated datatypes and fixed bugs.