fix declarations and tests