Fixes to last commit, based on comments from Nikerabbit

Change-Id: Idd011293cf141c972e980801c7c0628ce7ba034c