Fixed all parsing functions and made decent tests