Fixed bug: wrong return on recursive call