Small changes and fixes, #1 partially implemented