Add human error message and address NPE warning