Fixed build errors on WPF and WP7.