fixed some issues on const refs and return value of call