Updated throw statements to throw RuntimeException(e).