fixed a bunch of bugs, travis now passing