Fix slight bug in service code