Implemented more appropriate error propagation.