Bug fixes

https://github.com/DrKLO/Telegram/pull/581