Cleaned up functional test