Fix mixed declarations and code