Version 0.3: use endswith instead of find (thx stickell)