Patched specific issues pointed out in #3