Fixed possible NPE in getPrefix()