Strip comments when looking for number values.
Added WhileLocked() utility method.