Handel modifier const in getOccurrances

Fix for #1331. Const is not handled as a modifier, so add the handling for it.