Fixing a NullPointerException which is thrown on some setups.