Fixing bugs, improving built in functions