Model bug fixing