Engine test, fix bug