Fixed errors in works controller