Implemented feedback from @seanbarclay; fixed misc issues