Fixes bug where the method was throwing an exception  instead of returning null.