Fix for Issue #471 and #470

This is my first time using Git, let me know if I'm doing this right.

However I'm not new to Java :)