Fixed memory leak in user constructor