Bugs fixed in model