crash fixes
Better test
Merge pull request #4 from nouiz/GSoC2014_part2

a few fixes