Updated posts functions and test code.