Fix spacebar handling