Quickfix NPE fixes for vertical ruler. Extract constant and extract

local variable.