fixed bugs in system gral