Fixed errors and formatting for operations