Modified printing of function declarations; added some tests