Bugfix about object method in constructor