Fixed bug in function parsing