Most countries have laws that offer regulatory advantages to small firms, such as lower taxes or more flexible labor rules. To determine what firms are eligible to these advantages, it is necessary to define what characterizes a small firm. This is usually done by specifying thresholds in terms of the maximum number of employees, annual revenues, total assets, or a combination of all three. The existence of such thresholds gives firms incentives to strategically remain small to benefit from the regulatory advantages. It also provides researchers with an opportunity to analyze the effects of those regulations, by studying the behavior of firms that are close to the eligibility cutoff. In the first chapter, my co-author David Lopez-Rodriguez and I study the effects on firm behavior of a discontinuity in tax enforcement intensity in Spain. The Large Taxpayers' Unit (LTU), established in 1995, monitors and enforces the taxation of companies with operating revenue above €6 million, resulting in more frequent tax audits and more information requirements for those firms. We exploit this discontinuity to estimate the impact of tax enforcement on firms' reporting behavior, using a panel dataset of financial statements for Spanish firms from the period 1999-2011. We find an excess mass of firms locating, or "bunching", just below the revenue threshold. Bunching is stronger in the boom period (1999-2007) than in the recession period (2008-2011). Based on the number of bunching firms, we estimate that firms reduce reported revenue by up to 7.5% in the boom period to avoid falling in the high enforcement regime. A dynamic analysis shows that firm's revenue growth rates decline substantially as firms approach the LTU threshold from below, and there is short-term persistence (up to 3 years) in bunching behavior.In the second chapter, my co-author David Lopez-Rodriguez and I analyze whether bunching of firms below a discontinuity in tax enforcement intensity is due to production (real) or evasion responses. Using an extended theoretical framework, we derive predictions about the behavior of reported input costs under the polar hypothesis of a pure real response and a pure evasion response. We test the plausibility of the two hypotheses using graphical evidence on the patterns of reported input costs around the LTU threshold. This evidence suggests that bunching firms underreport their revenue, overreport their material input costs and underreport their labor costs in order to evade several taxes: corporate income tax, payroll tax and the value added tax (VAT). We also run panel regressions with firm fixed effects which broadly confirm the results from the graphical analysis. Overall, the results suggest that firms react to this tax enforcement policy mostly through changes in reporting, rather than changes in production. The efficiency costs of tax enforcement are thus likely to be small because tax evasion constitutes a reallocation of income to tax-evading firms, rather than a net loss for society. Finally, we do a rough estimation of the upper bound of corporate income tax evasion, which yields a modest amount of evasion.In the third chapter, I study the impact of a set of labor regulations in France that applies only to firms with more than 50 employees. These regulations increase the average labor cost per employee, giving firms an incentive to remain small. The firm size distribution shows strong bunching below the threshold for the period 2002-2008. In terms of growth patterns, the proportion of firms increasing their size from one year to the next drops almost by half at 49 employees, while the share of firms keeping employment constant doubles. I set up a stylized model where firms only choose their number of employees to derive an expression for the elasticity of labor demand, and then estimate it using the number of bunching firms as a sufficient statistic. I obtain a point estimate of e=0.055, which is statistically different from zero at the 10% level. Making an adjustment for the possibility that some firms do not respond to the regulations due to optimization frictions, I obtain a point estimate of e=0.572. The latter can be interpreted as an upper bound for the long-term structural elasticity, although it is imprecisely estimated (the standard error is 0.668). These point estimates are considerably below labor demand elasticities estimated in the literature, which according to Hamermesh (1993) tend to be in the interval (0.15,0.75). An intuitive explanation for why I obtain low point estimates is that bunching firms may be adjusting their production by increasing the use of other inputs instead of labor. I find some preliminary evidence supporting this hypothesis: median fixed assets per employee drop sharply at the notch, indicating that bunching firms have a higher capital-labor ratio than firms just above the threshold.