Fix somes bugs with old WP