[Issue #27] Fixed and cleaned up relevant code