Fixed errors in purchase