Make magic methods smarter, fix sample app