Fix precommit hook and fixed tests