Fix last row expansion problem