Change card.toView() to card.getView() for compatibility with latest GDK.
Fix minor warnings.