Added :pre and :post checks for some functions