Fix bugs from e804