Miscellaneous bug fixing

Now the code is able to be run with all the major methods without break.