fixed compiler warnings "returning reference to temporary"