fix a few bugs, make sourcing a second file work