Some more performance fixes

Change-Id: I8c9c742c9db9a006281dee6c9b591667f7cae5df