bugfixes (patches from Nektarios Anagnostopoulos)

git-svn-id: http://lire.googlecode.com/svn/trunk@219 f280a053-6817-128d-8a7e-cdf98506035a
git-svn-id: http://lire.googlecode.com/svn/trunk@220 f280a053-6817-128d-8a7e-cdf98506035a